package com.talkology.pilot.database.model;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

public class TeachersTimeMgt implements Serializable {
    private Integer index;

    private String name;

    private String classType;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date availableTime;

    private String localTime;

    private Integer hasHold;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updatedAt;

    private static final long serialVersionUID = 1L;

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getClassType() {
        return classType;
    }

    public void setClassType(String classType) {
        this.classType = classType == null ? null : classType.trim();
    }

    public Date getAvailableTime() {
        return availableTime;
    }

    public void setAvailableTime(Date availableTime) {
        this.availableTime = availableTime;
    }

    public String getLocalTime() {
        return localTime;
    }

    public void setLocalTime(String localTime) {
        this.localTime = localTime == null ? null : localTime.trim();
    }

    public Integer getHasHold() {
        return hasHold;
    }

    public void setHasHold(Integer hasHold) {
        this.hasHold = hasHold;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TeachersTimeMgt other = (TeachersTimeMgt) that;
        return (this.getIndex() == null ? other.getIndex() == null : this.getIndex().equals(other.getIndex()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getClassType() == null ? other.getClassType() == null : this.getClassType().equals(other.getClassType()))
            && (this.getAvailableTime() == null ? other.getAvailableTime() == null : this.getAvailableTime().equals(other.getAvailableTime()))
            && (this.getLocalTime() == null ? other.getLocalTime() == null : this.getLocalTime().equals(other.getLocalTime()))
            && (this.getHasHold() == null ? other.getHasHold() == null : this.getHasHold().equals(other.getHasHold()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getIndex() == null) ? 0 : getIndex().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getClassType() == null) ? 0 : getClassType().hashCode());
        result = prime * result + ((getAvailableTime() == null) ? 0 : getAvailableTime().hashCode());
        result = prime * result + ((getLocalTime() == null) ? 0 : getLocalTime().hashCode());
        result = prime * result + ((getHasHold() == null) ? 0 : getHasHold().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", index=").append(index);
        sb.append(", name=").append(name);
        sb.append(", classType=").append(classType);
        sb.append(", availableTime=").append(availableTime);
        sb.append(", localTime=").append(localTime);
        sb.append(", hasHold=").append(hasHold);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}